/*
********************************************************************************
* Copyright (C) 2021, xiang.D <dx_65535@163.com>.
* All right reserved.
*
* File Name   : consumer.cc
* Author      :
* Version     : V1.0
* Description :
* Journal     : 2021-01-08 init v1.0
* Brief       : Blog: https://blog.csdn.net/qq_38750572?spm=1001.2014.3001.5343
* Others      :
********************************************************************************
*/
#include <stdio.h>
#include "consumer.h"

const float PERSENT_ONEHUNDRED  = 1.0;
const float PERSENT_NINETY      = 0.9;
const float PERSENT_EIGHTY      = 0.8;

// 普通用户
CCommonUser::CCommonUser()
{
    mDiscountRate = PERSENT_ONEHUNDRED;
    mUserDesc = "Common User";
}

CCommonUser::~CCommonUser()
{

}

CCommonUser* CCommonUser::GetInstance()
{
    static CCommonUser mObj;
    return &mObj;
}

int CCommonUser::GetBirthdayPresent()
{
    int ret = 0;

    return ret;
}

// 白银会员
CSilverUser::CSilverUser()
{
    mDiscountRate = PERSENT_NINETY;
    mUserDesc = "Silver User";
}

CSilverUser::~CSilverUser()
{

}

CSilverUser* CSilverUser::GetInstance()
{
    static CSilverUser mObj;
    return &mObj;
}

int CSilverUser::GetBirthdayPresent()
{
    int ret = 0;

    return ret;
}

// 黄金会员
CGoldUser::CGoldUser()
{
    mDiscountRate = PERSENT_EIGHTY;
    mUserDesc = "Gold User";
}

CGoldUser::~CGoldUser()
{

}

CGoldUser* CGoldUser::GetInstance()
{
    static CGoldUser mObj;
    return &mObj;
}

int CGoldUser::GetBirthdayPresent()
{
    int ret = 0;

    return ret;
}


